package com.chinaunicom.smartcity.web;

import com.chinaunicom.smartcity.service.DemoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.Map;

/**
 * Created by wyt on 2019/7/30.
 */
@Controller
@RequestMapping("demo")
public class DemoController {

    @Autowired
    private DemoService service;

    @RequestMapping("index/{id}")
    public String toIndex(Map<String, Object> map,@PathVariable String id) {
        map.put("demo",service.getOne(id));
        return "demo/detail";
    }

}
